#ifndef COMMSHARE_H
#define COMMSHARE_H

#include <QObject>
#include <QMap>
#include <QMutex>
#include <SuperSerialPort/SuperSerialPort.h>
#include <SuperSocket/SuperSocket.h>
#include "BubbleWidget.h"
class CommShared
{
private:
    CommShared()
    {
        peerName = 0;
        m_iAccess = 0;
        m_calibrate1Value = 0;
        m_calibrate2Value = 0;
        m_dbCalibCoef = 0.0;
        m_dbCalibB = 0;
        m_dbCalibValue = 0;
        m_SpeedValue = 240;
        m_SelectN = -22;
        m_Tester = "";
        m_DutSn = "";
        m_openCalibrate = false;
        m_readBoradId = false;
        m_openMotor = false;
        m_openRoot = false;
        m_activePC = false;
        m_activeBar = false;
        m_serialPortMap.clear();
        m_socketMap.clear();
        m_bubbleWg = new BubbleWidget;
        m_LangMap.clear();
    }

public:
    static CommShared* GetInstance()
    {
        static CommShared pInstance;
        return &pInstance;
    }
public:
    int peerName;
    QMap<QString,SuperSerialPort*>  m_serialPortMap;
    QMap<QString,SuperSocket*>      m_socketMap;
    bool                            m_openCalibrate;
    bool                            m_openCalibrateRealTime;
    bool                            m_readBoradId;
    QString                         m_boradId;
    int                             m_calibrate0Value;
    int                             m_calibrate1Value;
    int                             m_calibrate2Value;
    float                           m_dbCalibCoef;
    int                             m_dbCalibB;
    int                             m_dbCalibValue;
    int                             m_SelectN;
    float                           m_SpeedValue;
    QString                         m_Tester;
    QString                         m_DutSn;
    uchar                           m_iAccess;
    bool                            m_openMotor;
    bool                            m_openRoot;
    bool                            m_activePC;
    bool                            m_activeBar;

    QMutex                          m_keyBoardMutex;
    BubbleWidget                    *m_bubbleWg;
    QVector<QMap<QString,QString>>  m_LangMap;
    QVector<QString>                m_LangType;


};

#endif // COMMSHARE_H
